<script>
    class Shape{
        constructor(width){
            this.width=width;
            console.log("调用了构造方法");
            this.area=function(){  //定义在实例上的方法
            }
        }
        show(){}
    }

    let s1=new Shape();
    console.log(s1);
</script>